﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Autofac;
using LakeSide.Core;
using System.Web.Mvc;
using Autofac.Integration.Mvc;

namespace LakeSide.Web
{
    /// <summary>
    /// 依赖注入配置
    /// </summary>
    public class RelyConfig
    {
        /// <summary>
        /// 注册依赖注入
        /// </summary>
        public static void RegisterGlobalRely()
        {
            var builder = new ContainerBuilder();
            //builder.RegisterControllers(typeof(MvcApplication).Assembly);
            builder.RegisterModule(new InjectionModule());
            var container = builder.Build();
            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
        }
    }
}